package star.oath.framework.generate;

import star.oath.framework.generate.template.MapperInterfaceTemplate;
import star.oath.framework.generate.template.MapperXmlTemplate;
import star.oath.framework.generate.template.ServiceImplementsClassTemplate;
import star.oath.framework.generate.template.ServiceInterfaceTemplate;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

public class CodeGenerator {

    public static final String SRC_MAIN_JAVA = "src/main/java/";
    public static final Pattern VALID_CLASS_NAME = Pattern.compile("^[a-zA-Z_$][a-zA-Z0-9_$]*$");

    public static void main(String[] args) {
        List<String> entityFilePaths = new ArrayList<>();
        entityFilePaths.add("star.oath.project.unit.model.UnitDef");
        entityFilePaths.add("star.oath.project.unit.model.UnitEquip");
        entityFilePaths.add("star.oath.project.unit.model.UnitUpgrade");

        for (String entityFilePath : entityFilePaths) {
            MapperInterfaceTemplate mapperInterfaceTemplate = new MapperInterfaceTemplate();
            mapperInterfaceTemplate.generateMapperInterface(entityFilePath);
            MapperXmlTemplate mapperXmlTemplate = new MapperXmlTemplate();
            mapperXmlTemplate.generateMapperXml(entityFilePath);
            ServiceInterfaceTemplate serviceInterfaceTemplate = new ServiceInterfaceTemplate();
            serviceInterfaceTemplate.generateServiceInterface(entityFilePath);
            ServiceImplementsClassTemplate serviceImplementsClassTemplate = new ServiceImplementsClassTemplate();
            serviceImplementsClassTemplate.generateServiceImplementsClass(entityFilePath);
        }
    }

}
